const http = require('http');
const server = http.createServer();
server.on('request',(req,res)=>{
    console.log(req);
    console.log(res);
    res.setHeader('content-type','text/plain;charset=utf-8')
    res.write('我们成功了');
    res.end();
})
server.listen(8080,(err)=>{
    if(!err){
        console.log('服务器启动成功');
    }else{
        console.log(err);
    }
})